﻿<?php 
	ini_set('display_errors', 1); 
	error_reporting(E_ALL); 
	
	require_once("../config/config.php");

	// partie centrale
	//$centre = "" ;	

	//partie droite
	$logBox = "../views/log.html" ;
	$style = "../styles/style.css" ;
	$titre = "Ajout client";

session_start();
	if(!isset($_SESSION["logAdmin"]) || $_SESSION["logAdmin"] == "" || isset($_POST["deconnexion"]) ){ // Si non-connecter ou si demande de déconnexion
		session_destroy();
		// On récupére la partie HTML à insérer
		header("location: ../index.php");	
	}
	else { // si déjà connectée
		// On récupére la partie HTML à insérer
		$logBox = "../views/logOk2.html" ;
	
	}

	$centre = 
'
<h1> Ajout client </h1>
<form id="form_ajout_client" method="post" action="../lib/ajouterClient.php" onsubmit="return main()">
		<table>
		<tr><td>Nom </td> <td><input id="nom" type="text" name="nom" /> </td></tr>
		<tr><td>Prénom </td> <td><input id="prenom" type="text" name="prenom" /> </td></tr>
		<tr><td>Mail </td> <td><input id="mail" type="text" name="mail" /></td></tr>
		<tr><td>Statut </td> 
			<td><select name="statut" default="OK">
				<option id="statut" name="statut" value="AR">AR</option>
				<option id="statut" name="statut" value="AR">PC</option>
				<option id="statut" name="statut" value="AR">OK</option>
			</select></td>
		</tr>
		<tr><td>RIB</td>
			<td><table>
				<tr><td>Banque</td><td>Agence</td><td>Compte</td><td>Cle</td></tr>
				<tr>
					<td> <input id="banque" type="text" name="banque" size="5"/></td>
					<td> <input id="agence" type="text" name="agence" size="5"/></td>
					<td> <input id="compte" type="text" name="compte" size="11"/></td>
					<td> <input id="cle" type="text" name="cle" size="2" /> </td>
				</tr>	
				</table>
			</td></tr>

		</table>
		
	<input id="buttonValidation" type="submit" name="Ajouter" value="Ajouter" />
	
</form>
';
	require_once(SQUELETTE2);
?>
